package com.geek.javase.ch02.test2;

/*
 *@author wangpeng
 *2025/10/10 13:01
 *@description TODO
 */

public class Father extends GrandFather {
    private String occupation;

    // 构造方法
    public Father(String name, int age, String occupation) {
        super(name, age);  // 调用父类构造方法
        this.occupation = occupation;
    }

    // 方法：显示父亲的相关信息
    public void getFather() {
        System.out.println("父亲姓名: " + name + ", 年龄: " + age + ", 职业: " + occupation);
    }
}
